// const http = reqire('http');

// http.createServer((req, res) => {

// }).listen(9002);
// console.log("server started...")

const http = require('http');

http.createServer((req,res) => {
    let body = [];
    req.on('error', (err) => {
        console.log(err);
    }).on('data', (chunk) => {
        body.push(chunk.toStrin());
    }).on('end', () => {
        body = Buffer.concat(body).toString();
        console.log('body',body);
        res.writeHead(200,{'ContentType' : 'text/html'});
        res.end('Hello world\n')
    })

}).listen(9002);
 console.log("server started...");